<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>js变量</title>
</head>
<body>
<script>
  var a = 1;
  var b = '字符串';
  var c = 2.0;
  var d = true;
  var arr = [1,4,2,3];
  var stu = {//定义对象
    name:'张三',
    age:18,
    gender:'男'

  };//json格式

  var n = null;
  var u = undefined;//未定义

  {
    var i1 = 5;//但是他还是全局的
    let i2 = 4;//局部
  }
  consle.log(i1);

  //常量
  const PI = 3.14;
  console.log(PI);


</script>
</body>
</html>